package dm71.espil;

import dm71.espil.models.User;

public class CurrentUser {
	private CurrentUser() 
	{
		
	}

	private static CurrentUser instance;

	public static CurrentUser Instance() {
		if (instance == null) {
			instance = new CurrentUser();
		}

		return instance;
	}

	private User user;
	public User GetUser() 
	{
		return user;
	}

	public Boolean IsAuthenticated() 
	{
		 return user != null && user.getUserID() > 0;
	}

	public void LogIn(User user) 
	{
		this.user = user;
	}
	
	public void LogOut()
	{
		this.user = null;
	}
}
